#-*- coding: utf-8 -*-
#! /usr/bin/python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
import sys

reload(sys)
sys.setdefaultencoding("utf-8")

def loginTb(username,password):
    '''
    jhfnetboy@gmail.com create to login taobao
    '''
    lgurl = 'https://login.taobao.com/member/login.jhtml'
    chrome.get(lgurl)
    try:
        ckbox = WebDriverWait(chrome, 10).until(lambda chrome : chrome.find_element_by_id("J_SafeLoginCheck"))
        ckbox.click()
        chrome.execute_script("document.getElementById('J_SafeLoginCheck').value = false")
    except:
        print 'fail to get element J_SafeLoginCheck' 




chrome = webdriver.Chrome()

#chrome.switch_to_active_element
chrome.get('http://login.taobao.com/member/logout.jhtml?spm=a1z02.1.0.6.wXTWrc&amp;f=top&amp;out=true&amp;redirectURL=http%3A%2F%2Fi.taobao.com%2Fmy_taobao.htm%3Fnekot%3Ds6S6%252BtfTtcTQodHy1351908154890')



